#ifndef __HANDLE_H__
#define __HANDLE_H__

class Handle
{
public:
    Handle() = default;
    Handle(Handle *succ);
    virtual ~Handle();

    void SetSuccessor(Handle *succ);
    Handle *GetSuccessor();
    virtual void Request() = 0;

private:
    Handle *succ_;
};

class HandleA : public Handle
{
public:
    HandleA() = default;
    HandleA(Handle *succ) : Handle(succ) {}
    ~HandleA() = default;

    void Request();
};

class HandleB : public Handle
{
public:
    HandleB() = default;
    HandleB(Handle *succ) : Handle(succ) {}
    ~HandleB() = default;

    void Request();
};

#endif

